Learn how to build a relaying transaction server with Sequence, enabling your server to dispatch transactions on behalf of users seamlessly.
msg.sender
is one of the Sequence Relayers wallet addresses. For Sequence Builder standard contracts, this is not a problem when combined with a relayed Transactions API request.
Environment Setup with Express Server
pnpm
(or some other node package manager) is installed with the following command:/mint
that can be called from the cli for testing.Give a try with this example curl request:Project & Access Key Management
Developer
which can be with this walkthrough.Finally, a Public Access Key
is required for the Transactions API, which can be acquired following this walkthough.Finally update the update the .env.example
to .env
with the following:Deploy Collectible Contract
.env
with your deployed collectible contract:v1
to v2
or v2
to future versions.Migration is a one-way process, once your wallet is migrated it cannot be reverted to a previous version.To catch any unwanted migration, you can use the onMigration
callback.callContract
function, include the following code that uses a single signer to relay transactions:.env
with a private key for a wallet that can be generated from the following app which is used for demo purposes. For production, we recommend to generate private keys securely locally on your computer via this example script.Then, update the PKEY
variable with the key:minter permission
to your Sequence Wallet Transactions API Address
.To do so, open your project, navigate to the Contracts
page, select your Linked contracts
and under Write Contract
tab expand the grantRole
method.Complete with the following details:bytes32 role
: 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6
address account
: <Generated Sequence Transactions API Wallet Address>
role
string inputted is the result of keccak256("MINTER_ROLE")
in solidity or ethers.solidityPackedKeccak256(ethers.toUtf8Bytes("MINTER_ROLE"))
in javascriptThis makes it so that only your specific address can mint from the contract, it will error otherwise.Complete the role update by clicking write
and sign the sponsored transaction.You application is now ready for you to send a test transaction from the client frontend by signing into your wallet and clicking mint.Give it a try!initWallet
function